#include "mainwindow.h"

#include <QtGui/QApplication>
#include <QDebug>
#include <QTranslator>
#include "global/globalvar.h"

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);

    globalvar::m_trans = new QTranslator();
    QLocale locale(QLocale::system());
    switch(static_cast<int>(locale.language()))
    {
    case QLocale::Chinese:
    {
        switch(static_cast<int>(locale.country()))
        {
        case QLocale::China:
        {
           globalvar::m_trans->load(QString("sudoku_zh_CN"));
        }
            break;
        case QLocale::HongKong:
        case QLocale::Taiwan:
        {
            globalvar::m_trans->load(QString("sudoku_zh_TW"));
        }
        default:
            break;
        }
    }
        break;
    case QLocale::Japanese:
    {
        globalvar::m_trans->load(QString("sudoku_jp"));
    }
        break;
    case QLocale::Korean:
    {
        globalvar::m_trans->load(QString("sudoku_ko"));
    }
        break;
    default:
    {
        globalvar::m_trans->load(QString("sudoku_en"));
    }
        break;
    }

    app.installTranslator(globalvar::m_trans);

    MainWindow mainWindow;
    mainWindow.setOrientation(MainWindow::ScreenOrientationLockPortrait);
    mainWindow.showFullScreen();

    return app.exec();
}
